package de.andreavicentini.teatralia.generate;

import org.magiclabs.html.model.*;
import java.util.*;

public class Layout implements ILayout {
  protected static String nl;
  public static synchronized Layout create(String lineSeparator)
  {
    nl = lineSeparator;
    Layout result = new Layout();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "";
  protected final String TEXT_2 = NL + NL + "<html>" + NL + "<head>" + NL + "<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"saeckestyle.css\" TITLE=\"Style\">" + NL + "<META HTTP-EQUIV=\"Pragma\" CONTENT=\"no-cache\">" + NL + "<title>";
  protected final String TEXT_3 = "</title>" + NL + "</head>" + NL + "" + NL + "<body>" + NL + "" + NL + "<div id=\"content\">";
  protected final String TEXT_4 = NL;
  protected final String TEXT_5 = NL + "</div>" + NL + "" + NL + "<div id=\"footer\">" + NL + "<a href=\"\">Kontakt</a>" + NL + "</div>" + NL + "" + NL + "</body>" + NL + "</html>";

	public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
    stringBuffer.append(TEXT_1);
    
Page page = (Page) argument;

    stringBuffer.append(TEXT_2);
    ?page.getTitle() 
    stringBuffer.append(TEXT_3);
    stringBuffer.append(TEXT_4);
    stringBuffer.append( page.renderContent() );
    stringBuffer.append(TEXT_5);
    return stringBuffer.toString();
  }
}